<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

class Home extends CI_Controller
{
	function __construct()
	{
		parent::__construct();		
		//if (!$this->tank_auth->is_logged_in()) redirect('auth/login');
	}

	function index()
	{			
		//default
		$data['ptitle'] = "Meinhardt - Home";
		$data['username'] = $this->tank_auth->get_username();
		$data['module'] = 'home';
		$data['active_header'] = 'home';
		//end default
		
		$data['content'] = $this->load->view('index',$data,true);		
		$this->load->view('default_view',$data);
	}
	
	function company_profile()
	{			
		//default
		$data['ptitle'] = "Meinhardt - Company Profile";
		$data['username'] = $this->tank_auth->get_username();
		$data['module'] = 'home';
		$data['active_header'] = 'home';
		//end default
		
		$data['content'] = $this->load->view('company_profile',$data,true);		
		$this->load->view('default_view',$data);
	}
	
	function projects()
	{			
		//default
		$data['ptitle'] = "Meinhardt - Projects";
		$data['username'] = $this->tank_auth->get_username();
		$data['module'] = 'home';
		$data['active_header'] = 'home';
		//end default
		
		$data['content'] = $this->load->view('projects',$data,true);		
		$this->load->view('default_view',$data);
	}
	
	function viewImage($imgid=false)
	{
		if($imgid)
		{
			$dt = $this->Default_db->getImage($imgid);
			if(count($dt))
			{
				$type = "image/jpeg";
				if(strstr($dt['image_name'],'png'))
					$type = "image/png";
				else if(strstr($dt['image_name'],'gif'))
					$type = "image/gif";			
				
				header("Content-length: ".$dt['image_size']);
				header("Content-type: $type");
				print $dt['image_data'];
			}
		}
	}
	
	function js() {
        $this->load->view('js/script.js');
    }
}

/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */